import React, { useContext } from 'react'
import BlogContext from '@/context/blogContext';
import Pagination from '@/components/client/common/Pagination';

export default function BlogPagination() {
  const { page, setPage, limit, activeTotal} = useContext(BlogContext);
  return (
    <div>
      <Pagination className={``} page={page} limit={limit} total={activeTotal} leftDisabled={page === 1} rightDisabled={page === Math.ceil(activeTotal / limit)} leftOnClick={() => setPage(page - 1)} rightOnClick={() => setPage(page + 1)}/>
    </div>
  )
}
